package com.aiju.bean;

import android.text.TextUtils;

import com.aiju.utils.StringUtil;

import java.io.Serializable;

/**
 * @author: 佐为
 * @date: 2016-11-23 16:56
 * @version: V1.0
 * @Description: 店铺
 */
public class Shop implements Serializable, Cloneable {

    private String id;              //店铺id
    private String parentStoreId;   //总店商铺编号
    private String shopName;        //店铺名称
    private String provinceCode;    //省编号
    private String cityCode;       //城市编号
    private String districtCode;    //区编号
    private String codeName;        //省市区总名称
    private String addressDetail;    //详细地址
    private String longitude;       //经度
    private String latitude;        //维度

    private String contactNumber;   //门店联系方式
    private String shopType;        //门店类型（0,总店 1，直营店，2加盟店）
    private String imageUrl;        //店铺图片
    private String storeId;         //店铺id
    private String createDate;      //创建时间
    private String modifyDate;      //修改时间
    private int alipay;             //支付
    private int wx;                 //微信
    private int qq;                 //qq\

    private String shareStatus;     //分享状态
    private Account shopAccount; //默认账本
    private MPoints mPoints;
    private String sortLetters;  //显示数据拼音的首字母

    private String isReputationShop;    //是否口碑店铺(1是，0否)
    private String reputationShopId;    //口碑店铺主键id
    private String modifyRelationGoods; //修改管理商品，1有；0无
    private String deleteRelationGoods; //删除管理商品的权限1有，0无
    private String manageOwnGoods;      //值为1或0；店主有没有管理自己商品的权利(如果有，则可以编辑新增删除自己的商品）1：有，0无
    private String reviewStatus;    //	口碑店铺是否审核通过（1通过，0不通过，2审核中）
    private String subMsg;          //审核不通过原因
    private String resultDesc;      //审核不通过原因，优先显示，如果为空，则显示subMsg

    private String isOpenSynchronize; //同步主店
    private boolean isERPGranted; //erp是否已经授权

    public String getIsOpenSynchronize() {
        return isOpenSynchronize;
    }

    public void setIsOpenSynchronize(String isOpenSynchronize) {
        this.isOpenSynchronize = isOpenSynchronize;
    }

    public String getShareStatus() {
        return shareStatus;
    }

    public void setShareStatus(String shareStatus) {
        this.shareStatus = shareStatus;
    }

    public String getSortLetters() {
        return sortLetters;
    }

    public void setSortLetters(String sortLetters) {
        this.sortLetters = sortLetters;
    }

    public String getDeleteRelationGoods() {
        if (TextUtils.isEmpty(deleteRelationGoods)) {
            return "0";
        }
        return deleteRelationGoods;
    }

    public void setDeleteRelationGoods(String deleteRelationGoods) {
        this.deleteRelationGoods = deleteRelationGoods;
    }

    public String getManageOwnGoods() {
        if (TextUtils.isEmpty(manageOwnGoods)) {
            return "0";
        }
        return manageOwnGoods;
    }

    public void setManageOwnGoods(String manageOwnGoods) {
        this.manageOwnGoods = manageOwnGoods;
    }

    public String getModifyRelationGoods() {
        if (TextUtils.isEmpty(modifyRelationGoods)) {
            return "0";
        }
        return modifyRelationGoods;
    }

    public void setModifyRelationGoods(String modifyRelationGoods) {
        this.modifyRelationGoods = modifyRelationGoods;
    }

    public int getQq() {
        return qq;
    }

    public void setQq(int qq) {
        this.qq = qq;
    }

    public String getContactNumber() {
        return contactNumber;
    }

    public void setContactNumber(String contactNumber) {
        this.contactNumber = contactNumber;
    }

    public String getAddressDetail() {
        if (TextUtils.isEmpty(addressDetail) || addressDetail.equals("null")) {
            return "";
        }
        return addressDetail;
    }

    public void setAddressDetail(String addressDetail) {
        this.addressDetail = addressDetail;
    }

    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    public String getCodeName() {
        if (TextUtils.isEmpty(codeName) || codeName.equals("null")) {
            return "";
        }
        return codeName;
    }

    public void setCodeName(String codeName) {
        this.codeName = codeName;
    }

    public String getDistrictCode() {
        return districtCode;
    }

    public void setDistrictCode(String districtCode) {
        this.districtCode = districtCode;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getProvinceCode() {
        return provinceCode;
    }

    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }

    boolean selected;

    public boolean isSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        this.selected = selected;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public String getParentStoreId() {
        return parentStoreId;
    }

    public void setParentStoreId(String parentStoreId) {
        this.parentStoreId = parentStoreId;
    }

    public String getShopType() {
        return shopType;
    }

    public String getShopTypeString() {
        if (shopType.equals("0")) {
            return "总店";
        } else if (shopType.equals("1")) {
            return "直营店";
        } else {
            return "加盟店";
        }
    }

    public void setShopType(String shopType) {
        this.shopType = shopType;
    }

    public String getIsReputationShop() {
        if (TextUtils.isEmpty(isReputationShop)) {
            return "0";
        }
        return isReputationShop;
    }

    public void setIsReputationShop(String isReputationShop) {
        this.isReputationShop = isReputationShop;
    }

    public String getReputationShopId() {
        return reputationShopId;
    }

    public void setReputationShopId(String reputationShopId) {
        this.reputationShopId = reputationShopId;
    }

    public String getReviewStatus() {
        return reviewStatus;
    }

    public void setReviewStatus(String reviewStatus) {
        this.reviewStatus = reviewStatus;
    }

    public String getSubMsg() {
        return subMsg;
    }

    public void setSubMsg(String subMsg) {
        this.subMsg = subMsg;
    }

    public String getResultDesc() {
        return resultDesc;
    }

    public void setResultDesc(String resultDesc) {
        this.resultDesc = resultDesc;
    }

    public MPoints getmPoints() {
        return mPoints;
    }

    public void setmPoints(MPoints mPoints) {
        this.mPoints = mPoints;
    }

    public Account getShopAccount() {
        return shopAccount;
    }

    public void setShopAccount(Account shopAccount) {
        this.shopAccount = shopAccount;
    }

    public boolean isAlipay() {
        return alipay == 1;
    }

    public boolean isWx() {
        return wx == 1;
    }

    public int getAlipay() {
        return alipay;
    }

    public void setAlipay(int alipay) {
        this.alipay = alipay;
    }

    public int getWx() {
        return wx;
    }

    public void setWx(int wx) {
        this.wx = wx;
    }

    public boolean isDiscount() {
        return false;
    }

    public String getStoreId() {
        return storeId;
    }

    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }

    public String getCreateDate() {
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getImageUrl() {
        if (StringUtil.isBlank(imageUrl))
            return "";
        else
            return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public String getModifyDate() {
        return modifyDate;
    }

    public void setModifyDate(String modifyDate) {
        this.modifyDate = modifyDate;
    }

    public Object clone() {
        Object o = null;
        try {
            o = (Shop) super.clone();//Object中的clone()识别出你要复制的是哪一
// 个对象。
        } catch (CloneNotSupportedException e) {
            System.out.println(e.toString());
        }
        return o;
    }

    public boolean isOpenSynchronize() {
        if (TextUtils.isEmpty(isOpenSynchronize) || isOpenSynchronize.equals("null")) {
            return false;
        }
        return isOpenSynchronize.equals("1");
    }

    public boolean isERPGranted() {
        return isERPGranted;
    }

    public void setERPGranted(boolean ERPGranted) {
        isERPGranted = ERPGranted;
    }
}
